import {createStore} from 'redux'

const initState = {
  city: '北京',
  detailStr: '',
  footer: true,
  video: {},
  cinema: {}
}

function counter(state = initState, action) {
  switch(action.type) {
    case 'changeCity':
    return {...state, city: action.data };
    case 'changeDetailStr':
      return {...state, detailStr: action.data };
    case 'changeFooter':
      return {...state, footer: action.data };
    case 'changeVideo':
      return {...state, video: action.data };
    case 'changeCinema':
      return {...state, cinema: action.data };
    default:
    return state;
  }
}

const store = createStore(counter)

export default store